{% extends "cartoon/cartoonbase.html" %}
{% block title  %}
<title>查找CARTOON</title>
{% endblock %}
{% block content %}
<form action="search" method="POST">
    {{ form.as_table }}

    <p></p><input type="submit" value="查找"></p>
</form>

{% if results %}
    <table border="1px" cellspacing="0px">
        <tr>
            <th align=left width="20%">Name</th>
            <th align=left width="20%">Path</th>
            <th align=left width="5%">Episodes</th>
            <th align=left width="10%">Company</th>
            <th align=left width="5%">Date</th>
            <th align=left width="10%%">Formats</th>
            <th align=left width="15%">Pictures</th>
        </tr>

    {% for cartoon in results %}
        <tr>
        <td width="20%">{{ cartoon.name }}</td>
        <td width="20%">{{ cartoon.path }}</td>
        <td width="5%">{{ cartoon.episodeNum }}</td>
        <td width="10%">{{ cartoon.company }}</td>
        <td width="5%">{{ cartoon.date|date:"Y-m-d" }}</td>
        <td width="10%">
            {% for format in cartoon.vFormats.all %}
                <p>{{ format }}</p>
                
            {% endfor %}
            
            
        </td>

        <td width="15%">
            {% for pic in cartoon.cartoonpicture_set.all %}
                <a href="{{ pic.getImgUrl }}" width="60" height="40" rel="lightbox[{{ pic.pname }}]">
                    <img src={{ pic.getThumbUrl }}>
                </a>
            {% endfor %}
        </td>
        <td width="10%">
            <a href="{{ cartoon.getId }}/edit" target=”_blank”>编辑</a>
            <a href="{{ cartoon.getId }}/deletecartoonpre" target=”_blank”>删除</a>
        </td>
        </tr>
    {% endfor %}
    </table>
{% endif %}
{% endblock %}